package com.dd.cloud.user.req.order;

import lombok.Data;

import javax.validation.constraints.NotEmpty;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * @author Lx
 * @version 1.0
 */
@Data
public class OrderSettlementReq {
    /**
     * 药房id
     */
    private String pharmacyId;
    /**
     * 开始时间
     */
    private LocalDateTime start;
    /**
     * 开始时间
     */
    private LocalDate startDate;
    /**
     * 结束时间
     */
    private LocalDateTime end;
    /**
     * 结束时间
     */
    private LocalDate endDate;
    /**
     * 订单号
     */
    @NotEmpty(message = "订单号不能为空")
    private String orderNos;
    /**
     * 订单号数组
     */
    private String[] orderNoArr;

    public boolean verify() {
        this.end = this.endDate != null ? this.endDate.atTime(23, 59, 59) : null;
        if (this.startDate != null) {
            start = startDate.atTime(0, 0,0);
            return this.end == null;
        } else {
            return false;
        }
    }
}
